package esi.ws;

import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.soap.SOAPException;

@WebService
public interface MovieService {

    // API access details
    String CONSUMER_KEY = "pu3pattyph3fbyxny2u7jea3";
    String SECRET = "6Emg9Z4phr";

    /**
     * Searches movies by given search term. 25 top matched results are returned.
     * 
     * @param term part of the movie name
     * @return {@link SearchMoviesResponse} object with response details
     * @throws SOAPException
     */
    SearchMoviesResponse searchMovies(@WebParam(name = "searchTerm") String term) throws SOAPException;

    /**
     * @param movieId movie id in the form of "596974"
     * @return {@link MovieResponse} object with details
     * @throws SOAPException
     */
    MovieResponse getMovie(@WebParam(name = "movieId") String movieId) throws SOAPException;

    /**
     * @param searchTerm term to browse by
     * @param resultsPerPage number of movies fetched for a page. Must be between 0 and 100!
     * @param pageNr page number to fetch. To get reasonable results please take into account previously used {@code reultsPerPage}.
     * @return {@link SearchMoviesResponse} object with response details
     * @throws SOAPException
     */
    SearchMoviesResponse browseMovies(@WebParam(name = "searchTerm") String searchTerm, @WebParam(name = "resultsPerPage") int resultsPerPage, @WebParam(name = "pageNr") int pageNr)
            throws SOAPException;

}
